package grape.composite.rest.client.impl.workcalendar;

import grape.composite.rest.client.workcalendar.WorkCalendarClient;
import grape.composite.rest.workcalendar.form.WorkCalendarListForm;
import grape.composite.rest.workcalendar.mvc.WorkCalendarInnerController;
import grape.composite.service.workcalendar.po.WorkCalendar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by yangwei
 * Created at 2020/5/22 19:07
 */
@Component
public class WorkCalendarClientImpl implements WorkCalendarClient {
    @Autowired
    private WorkCalendarInnerController workCalendarInnerController;
    @Override
    public List<WorkCalendar> list( Integer year,
                                    Integer month,
                                    Integer day,
                                    String typeDictId,
                                    String dateTypeDictId) {
        WorkCalendarListForm workCalendarListForm = new WorkCalendarListForm();
        workCalendarListForm.setYear(year);
        workCalendarListForm.setMonth(month);
        workCalendarListForm.setDateTypeDictId(dateTypeDictId);
        workCalendarListForm.setDay(day);
        workCalendarListForm.setTypeDictId(typeDictId);
        return workCalendarInnerController.list(workCalendarListForm);
    }
}
